package org.xtense.engine;

import java.util.HashMap;

public class IConstants {
	//type
	public static final int ATTRIBUTE = 1;
	public static final int ELEMENT = 2;
	public static final int TEXT = 3;
	public static final int DOCUMENT = 4;
	public static final int PATH = 5;
	
	//Table names in the database
	public static final String Element_Table = "element";
	public static final String Document_Table = "document";
	public static final String Attribute_Table = "attribute";
	public static final String Text_Table = "text";
	public static final String Path_Table = "path";
	
	public static HashMap<Integer, String> AETPtables = new HashMap<Integer, String>();
	public static HashMap<Integer, String> Dtables = new HashMap<Integer, String>();
	static {
		AETPtables.put(ATTRIBUTE, Attribute_Table);
		AETPtables.put(ELEMENT, Element_Table);
		AETPtables.put(TEXT, Text_Table);
		AETPtables.put(PATH, Path_Table);
		Dtables.put(DOCUMENT, Document_Table);
	}

	//Column names in the database
	public static final String Element_Pre = "elementPre";
	public static final String Element_Tag = "elementTag";
	public static final String Parent_Pre = "parentPre";

	public static final String Attribute_Name = "attributeName";
	public static final String Attribute_Value = "attributeValue";

	public static final String Document_Name = "documentName";
	public static final String Document_ID = "documentId";
	public static final String Document_StoredTime = "storedTime";

	public static final String Text_Content = "textContent";
	
	public static final String Path_Content = "pathValue";
	
	//sql
	public static final String Sql_Select_One = "SELECT {0} FROM {1} WHERE {2}";
	public static final String Sql_Select_Two = "SELECT {0} FROM {1} WHERE {2} AND {3}";
	public static final String Sql_And = "{0} AND {1}";
	public static final String Sql_Int_Equal = "{0} = {1}";
	public static final String Sql_String_Equal = "{0} = ''{1}''";
	public static final String Sql_LIKE = "{0} LIKE ''{1}''";
	public static final String Sql_IN = "{0} IN ({1})";
	public static final String Sql_Insert = "INSERT INTO {0} VALUES ({1})";
	public static final String Sql_Delete = "DELETE FROM {0} WHERE {1}";
	public static final String Sql_Update = "UPDATE {0} SET {1} WHERE {2}";
	public static final String Sql_Greater_Than = "{0} > {1}";
	
	public static final String tempRoot = "tempRoot";
}
